home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / screen32.lha / screen-3.2b / configure < prev    next >
Text File  |  1992-10-28  |  19KB  |  835 lines

  1. #!/bin/sh
  2. # Guess values for system-dependent variables and create Makefiles.
  3. # Generated automatically using autoconf.
  4. # Copyright (C) 1991, 1992 Free Software Foundation, Inc.
  5.  
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2, or (at your option)
  9. # any later version.
  10.  
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. # GNU General Public License for more details.
  15.  
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  
  20. # Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp] [--no-create]
  21. #        [--prefix=PREFIX] [--exec_prefix=PREFIX] [--with-PROGRAM] [TARGET]
  22. # Ignores all args except --srcdir, --prefix, --exec_prefix, and --no-create.
  23.  
  24. trap 'rm -f conftest* core; exit 1' 1 3 15
  25.  
  26. for arg
  27. do
  28.   # Handle --exec_prefix with a space before the argument.
  29.   if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
  30.   # Handle --host with a space before the argument.
  31.   elif test x$next_host = xyes; then next_host=
  32.   # Handle --prefix with a space before the argument.
  33.   elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
  34.   # Handle --srcdir with a space before the argument.
  35.   elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
  36.   else
  37.     case $arg in
  38.      -exec_prefix=* | --exec_prefix=* | --exec_prefi=* | --exec_pref=* | --exec_pre=* | --exec_pr=* | --exec_p=* | --exec_=* | --exec=* | --exe=* | --ex=* | --e=*)
  39.     exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  40.      -exec_prefix | --exec_prefix | --exec_prefi | --exec_pref | --exec_pre | --exec_pr | --exec_p | --exec_ | --exec | --exe | --ex | --e)
  41.     next_exec_prefix=yes ;;
  42.  
  43.      -gas | --gas | --ga | --g) ;;
  44.  
  45.      -host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
  46.      -host | --host | --hos | --ho | --h)
  47.     next_host=yes ;;
  48.  
  49.      -nfp | --nfp | --nf) ;;
  50.  
  51.      -no-create | --no-create | --no-creat | --no-crea | --no-cre | --no-cr | --no-c | --no- | --no)
  52.         no_create=1 ;;
  53.  
  54.      -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  55.     prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  56.      -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  57.     next_prefix=yes ;;
  58.  
  59.      -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
  60.     srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  61.      -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
  62.     next_srcdir=yes ;;
  63.  
  64.      -with-* | --with-*) ;;
  65.  
  66.      *) ;;
  67.     esac
  68.   fi
  69. done
  70.  
  71. rm -f conftest*
  72. compile='${CC-cc} $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1'
  73.  
  74. # A filename unique to this package, relative to the directory that
  75. # configure is in, which we can look for to find out if srcdir is correct.
  76. unique_file=screen.c
  77.  
  78. # Find the source files, if location was not specified.
  79. if test -z "$srcdir"; then
  80.   srcdirdefaulted=yes
  81.   # Try the directory containing this script, then `..'.
  82.   prog=$0
  83.   confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
  84.   test "X$confdir" = "X$prog" && confdir=.
  85.   srcdir=$confdir
  86.   if test ! -r $srcdir/$unique_file; then
  87.     srcdir=..
  88.   fi
  89. fi
  90. if test ! -r $srcdir/$unique_file; then
  91.   if test x$srcdirdefaulted = xyes; then
  92.     echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  93.   else
  94.     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  95.   fi
  96.   exit 1
  97. fi
  98. # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
  99. # But we can't avoid them for `..', to make subdirectories work.
  100. case $srcdir in
  101.   .|/*|~*) ;;
  102.   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
  103. esac
  104.  
  105.  
  106. compile='rm -f conftest.t;
  107.   mv conftest.c conftest.t;
  108.   echo "$DEFS" > conftest.c;
  109.   cat conftest.t >> conftest.c;
  110.   rm -f conftest.t;
  111.   ${CC-cc} conftest.c -o conftest $LIBS >/dev/null 2>&1'
  112.  
  113.  
  114. if test -z "$CC"; then
  115.   echo checking for gcc
  116.   saveifs="$IFS"; IFS="${IFS}:"
  117.   for dir in $PATH; do
  118.     test -z "$dir" && dir=.
  119.     if test -f $dir/gcc; then
  120.       CC="gcc"
  121.       break
  122.     fi
  123.   done
  124.   IFS="$saveifs"
  125. fi
  126. test -z "$CC" && CC="cc"
  127.  
  128. # Find out if we are using GNU C, under whatever name.
  129. cat <<EOF > conftest.c
  130. #ifdef __GNUC__
  131.   yes
  132. #endif
  133. EOF
  134. ${CC-cc} -E conftest.c > conftest.out 2>&1
  135. if egrep yes conftest.out >/dev/null 2>&1; then
  136.   GCC=1 # For later tests.
  137.   CC="$CC -O"
  138. fi
  139. rm -f conftest*
  140.  
  141. echo checking how to run the C preprocessor
  142. if test -z "$CPP"; then
  143.   CPP='${CC-cc} -E'
  144.   cat <<EOF > conftest.c
  145. $DEFS
  146. #include <stdio.h>
  147. EOF
  148. err=`eval "$CPP conftest.c 2>&1 >/dev/null"`
  149. if test -z "$err"; then
  150.   :
  151. else
  152.   CPP=/lib/cpp
  153. fi
  154. rm -f conftest*
  155. fi
  156.  
  157. if test -n "$GCC"; then
  158.   echo checking whether -traditional is needed
  159.   pattern="Autoconf.*'x'"
  160.   prog='#include <sgtty.h>
  161. Autoconf TIOCGETP'
  162.   cat <<EOF > conftest.c
  163. $DEFS
  164. $prog
  165. EOF
  166. eval "$CPP conftest.c > conftest.out 2>&1"
  167. if egrep "$pattern" conftest.out >/dev/null 2>&1; then
  168.   need_trad=1
  169. fi
  170. rm -f conftest*
  171.  
  172.  
  173.   if test -z "$need_trad"; then
  174.     prog='#include <termio.h>
  175. Autoconf TCGETA'
  176.     cat <<EOF > conftest.c
  177. $DEFS
  178. $prog
  179. EOF
  180. eval "$CPP conftest.c > conftest.out 2>&1"
  181. if egrep "$pattern" conftest.out >/dev/null 2>&1; then
  182.   need_trad=1
  183. fi
  184. rm -f conftest*
  185.  
  186.   fi
  187.   test -n "$need_trad" && CC="$CC -traditional"
  188. fi
  189.  
  190. # Make sure to not get the incompatible SysV /etc/install and
  191. # /usr/sbin/install, which might be in PATH before a BSD-like install,
  192. # or the SunOS /usr/etc/install directory, or the AIX /bin/install.
  193. if test -z "$INSTALL"; then
  194.   echo checking for install
  195.   saveifs="$IFS"; IFS="${IFS}:"
  196.   for dir in $PATH; do
  197.     test -z "$dir" && dir=.
  198.     case $dir in
  199.     /etc|/usr/sbin|/usr/etc) ;;
  200.     *)
  201.       if test -f $dir/install; then
  202.     if grep dspmsg $dir/install >/dev/null 2>&1; then
  203.       : # AIX
  204.     else
  205.       INSTALL="$dir/install -c"
  206.       INSTALL_PROGRAM='$(INSTALL)'
  207.       INSTALL_DATA='$(INSTALL) -m 644'
  208.       break
  209.     fi
  210.       fi
  211.       ;;
  212.     esac
  213.   done
  214.   IFS="$saveifs"
  215. fi
  216. INSTALL=${INSTALL-cp}
  217. INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
  218. INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
  219.  
  220.  
  221. echo checking for POSIXized ISC
  222. if test -d /etc/conf/kconfig.d &&
  223.   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
  224. then
  225.   ISC=1 # If later tests want to check for ISC.
  226.   DEFS="${DEFS}#define _POSIX_SOURCE 1
  227. "
  228.   if test -n "$GCC"; then
  229.     CC="$CC -posix"
  230.   else
  231.     CC="$CC -Xp"
  232.   fi
  233. fi
  234.  
  235. if test -n "$ISC"; then
  236.   DEFS="${DEFS}#define ISC 1
  237. " LIBS="$LIBS -linet"
  238. fi
  239.  
  240. echo checking for RiscOS
  241. if test -f /lib/libmld.a; then # RiscOS.
  242.   test -z "$GCC" && CC="$CC -systype bsd43"
  243.   DEFS="${DEFS}#define MIPS 1
  244. " LIBS="$LIBS -lmld" # for loadavg.
  245. fi
  246.  
  247. echo checking for Ultrix
  248. cat <<EOF > conftest.c
  249. $DEFS
  250. #if defined(ultrix) || defined(__ultrix) || defined(__ultrix)
  251.   yes
  252. #endif
  253.  
  254. EOF
  255. eval "$CPP conftest.c > conftest.out 2>&1"
  256. if egrep "yes" conftest.out >/dev/null 2>&1; then
  257.   ULTRIX=1
  258. fi
  259. rm -f conftest*
  260.  
  261.  
  262. if test -n "$ULTRIX"; then
  263.   test -z "$GCC" && CC="$CC -YBSD"
  264. else
  265.   # POSIX termios is broken on Ultrix so don't look for it.
  266. echo checking for POSIX.1
  267. cat <<EOF > conftest.c
  268. $DEFS
  269. #include <sys/types.h>
  270. #include <unistd.h>
  271. main () {
  272. #ifdef _POSIX_VERSION
  273.   yes
  274. #endif
  275.  
  276. EOF
  277. eval "$CPP conftest.c > conftest.out 2>&1"
  278. if egrep "yes" conftest.out >/dev/null 2>&1; then
  279.   DEFS="${DEFS}#define POSIX 1
  280. "
  281. fi
  282. rm -f conftest*
  283.  
  284. fi
  285.  
  286. echo checking for BSD job control
  287. echo "#include <sys/types.h>
  288. #include <sys/ioctl.h>
  289. main() { exit(0); } t() { int x = TIOCNOTTY; }" > conftest.c
  290. if eval $compile; then
  291.   DEFS="${DEFS}#define BSDJOBS 1
  292. "
  293. fi
  294. rm -f conftest*
  295.  
  296.  
  297. echo checking for termio or termios
  298. cat <<EOF > conftest.c
  299. $DEFS
  300. #include <termios.h>
  301. EOF
  302. err=`eval "$CPP conftest.c 2>&1 >/dev/null"`
  303. if test -z "$err"; then
  304.   DEFS="${DEFS}#define TERMIO 1
  305. "
  306. fi
  307. rm -f conftest*
  308. cat <<EOF > conftest.c
  309. $DEFS
  310. #include <termio.h>
  311. EOF
  312. err=`eval "$CPP conftest.c 2>&1 >/dev/null"`
  313. if test -z "$err"; then
  314.   DEFS="${DEFS}#define TERMIO 1
  315. "
  316. fi
  317. rm -f conftest*
  318.  
  319. echo checking for termcap or terminfo
  320. if test ! -f /etc/termcap && test ! -f /usr/share/lib/termcap; then
  321.   DEFS="${DEFS}#define TERMINFO 1
  322. " LIBS="$LIBS -lcurses"
  323. else
  324.   LIBS="$LIBS -ltermcap"
  325. fi
  326.  
  327. echo checking for shadow.h
  328. cat <<EOF > conftest.c
  329. $DEFS
  330. #include <shadow.h>
  331. EOF
  332. err=`eval "$CPP conftest.c 2>&1 >/dev/null"`
  333. if test -z "$err"; then
  334.   DEFS="${DEFS}#define SHADOWPW 1
  335. "
  336. fi
  337. rm -f conftest*
  338.  
  339.  
  340. echo checking for System V
  341. echo "#include <sys/types.h>
  342. #include <signal.h>
  343. #include <fcntl.h>
  344. main() { exit(0); } t() { int x = SIGCHLD | FNDELAY; }" > conftest.c
  345. if eval $compile; then
  346.   :
  347. else
  348.   DEFS="${DEFS}#define SYSV 1
  349. "
  350. fi
  351. rm -f conftest*
  352.  
  353.  
  354. echo "${DEFS}#include <signal.h>" > conftest.c
  355. eval "$CPP conftest.c > conftest.out 2>&1"
  356. if egrep "(void|sighandler_t).*signal" conftest.out >/dev/null 2>&1; then
  357.   DEFS="${DEFS}#define SIGVOID 1
  358. "
  359. fi
  360. rm -f conftest*
  361.  
  362.  
  363. echo checking for directory library header
  364. echo checking for dirent.h
  365. cat <<EOF > conftest.c
  366. $DEFS
  367. #include <dirent.h>
  368. EOF
  369. err=`eval "$CPP conftest.c 2>&1 >/dev/null"`
  370. if test -z "$err"; then
  371.   DEFS="${DEFS}#define DIRENT 1
  372. " dirheader=dirent.h
  373. fi
  374. rm -f conftest*
  375.  
  376. if test -z "$dirheader"; then
  377. echo checking for sys/ndir.h
  378. cat <<EOF > conftest.c
  379. $DEFS
  380. #include <sys/ndir.h>
  381. EOF
  382. err=`eval "$CPP conftest.c 2>&1 >/dev/null"`
  383. if test -z "$err"; then
  384.   DEFS="${DEFS}#define SYSNDIR 1
  385. " dirheader=sys/ndir.h
  386. fi
  387. rm -f conftest*
  388.  
  389. fi
  390. if test -z "$dirheader"; then
  391. echo checking for sys/dir.h
  392. cat <<EOF > conftest.c
  393. $DEFS
  394. #include <sys/dir.h>
  395. EOF
  396. err=`eval "$CPP conftest.c 2>&1 >/dev/null"`
  397. if test -z "$err"; then
  398.   DEFS="${DEFS}#define SYSDIR 1
  399. " dirheader=sys/dir.h
  400. fi
  401. rm -f conftest*
  402.  
  403. fi
  404.  
  405. echo checking for closedir return value
  406. cat <<EOF > conftest.c
  407. #include <sys/types.h>
  408. #include <$dirheader>
  409. int closedir(); main() { exit(0); }
  410. EOF
  411. eval $compile
  412. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  413.   :
  414. else
  415.   DEFS="${DEFS}#define VOID_CLOSEDIR 1
  416. "
  417. fi
  418. rm -f conftest*
  419.  
  420.  
  421. echo checking for getutent
  422. echo "#include <time.h> /* to get time_t on SCO */
  423. #include <utmp.h>
  424. main() { exit(0); } t() { int x = DEAD_PROCESS; getutent(); }" > conftest.c
  425. if eval $compile; then
  426.   DEFS="${DEFS}#define GETUTENT 1
  427. "
  428. fi
  429. rm -f conftest*
  430.  
  431.  
  432. # Check for the 4.4BSD definition of getloadavg.
  433. echo checking for libutils
  434. test -f /usr/lib/libutils.a && LIBS="$LIBS -lutils"
  435. for func in getloadavg
  436. do
  437. echo checking for ${func}
  438. echo "
  439. main() { exit(0); } t() { 
  440. /* Override any gcc2 internal prototype to avoid an error.  */
  441. extern char ${func}(); ${func}(); }" > conftest.c
  442. if eval $compile; then
  443.   :
  444. else
  445.   LIBOBJS="$LIBOBJS ${func}.o"
  446. fi
  447. rm -f conftest*
  448.  
  449. done
  450.  
  451.  
  452. case "$LIBOBJS" in
  453. *getloadavg*)
  454. echo checking for sys/dg_sys_info.h
  455. cat <<EOF > conftest.c
  456. $DEFS
  457. #include <sys/dg_sys_info.h>
  458. EOF
  459. err=`eval "$CPP conftest.c 2>&1 >/dev/null"`
  460. if test -z "$err"; then
  461.   DEFS="${DEFS}#define DGUX 1
  462. " have_sym=1
  463. fi
  464. rm -f conftest*
  465.  
  466. if test -z "$have_sym"; then
  467. # Solaris 2 does not use dwarf, but it's still SVR4.
  468. echo checking for elf.h
  469. cat <<EOF > conftest.c
  470. $DEFS
  471. #include <elf.h>
  472. EOF
  473. err=`eval "$CPP conftest.c 2>&1 >/dev/null"`
  474. if test -z "$err"; then
  475.   DEFS="${DEFS}#define SVR4 1
  476. " LIBS="$LIBS -lelf" have_sym=1
  477. fi
  478. rm -f conftest*
  479.  
  480. fi
  481. if test -z "$have_sym"; then
  482. echo checking for inq_stats/cpustats.h
  483. cat <<EOF > conftest.c
  484. $DEFS
  485. #include <inq_stats/cpustats.h>
  486. EOF
  487. err=`eval "$CPP conftest.c 2>&1 >/dev/null"`
  488. if test -z "$err"; then
  489.   DEFS="${DEFS}#define UMAX4_3 1
  490. " DEFS="${DEFS}#define UMAX 1
  491. " have_sym=1
  492. fi
  493. rm -f conftest*
  494.  
  495. fi
  496. if test -z "$have_sym"; then
  497. echo checking for sys/cpustats.h
  498. cat <<EOF > conftest.c
  499. $DEFS
  500. #include <sys/cpustats.h>
  501. EOF
  502. err=`eval "$CPP conftest.c 2>&1 >/dev/null"`
  503. if test -z "$err"; then
  504.   DEFS="${DEFS}#define UMAX 1
  505. " have_sym=1
  506. fi
  507. rm -f conftest*
  508.  
  509. fi
  510. if test -z "$have_sym"; then
  511. echo checking for nlist.h
  512. cat <<EOF > conftest.c
  513. $DEFS
  514. #include <nlist.h>
  515. EOF
  516. err=`eval "$CPP conftest.c 2>&1 >/dev/null"`
  517. if test -z "$err"; then
  518.   DEFS="${DEFS}#define NLIST_STRUCT 1
  519. "
  520. echo checking for n_un in struct nlist
  521. echo "#include <nlist.h>
  522. main() { exit(0); } t() { struct nlist n; n.n_un.n_name = 0; }" > conftest.c
  523. if eval $compile; then
  524.   DEFS="${DEFS}#define NLIST_NAME_UNION 1
  525. "
  526. fi
  527. rm -f conftest*
  528.  
  529. fi
  530. rm -f conftest*
  531. fi
  532. ;;
  533. esac
  534.  
  535.  
  536. echo checking for mknod declaration
  537. cat <<EOF > conftest.c
  538. #include <sys/types.h>
  539. #include <sys/stat.h>
  540. char *mknod(short); main() {}
  541. EOF
  542. eval $compile
  543. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  544.   :
  545. else
  546.   DEFS="${DEFS}#define MKNOD_DECLARED 1
  547. "
  548. fi
  549. rm -f conftest*
  550.  
  551. echo checking for setpgid declaration
  552. cat <<EOF > conftest.c
  553. #include <sys/types.h>
  554. #include <unistd.h>
  555. char *setpgid(short); main() {}
  556. EOF
  557. eval $compile
  558. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  559.   :
  560. else
  561.   DEFS="${DEFS}#define SETPGID_DECLARED 1
  562. "
  563. fi
  564. rm -f conftest*
  565.  
  566. echo checking for setreuid
  567. echo "
  568. main() { exit(0); } t() { setreuid(); }" > conftest.c
  569. if eval $compile; then
  570.   :
  571. else
  572.   DEFS="${DEFS}#define NOREUID 1
  573. "
  574. fi
  575. rm -f conftest*
  576.  
  577.  
  578. echo checking for getttyent
  579. echo "
  580. main() { exit(0); } t() { getttyent(); }" > conftest.c
  581. if eval $compile; then
  582.   DEFS="${DEFS}#define GETTTYENT 1
  583. "
  584. fi
  585. rm -f conftest*
  586.  
  587.  
  588. echo checking whether bcopy handles overlapping arguments
  589. cat <<EOF > conftest.c
  590. main() {
  591.   char buf[10];
  592.   strcpy(buf, "abcdefghi");
  593.   bcopy(buf, buf + 2, 3);
  594.   if (!strncmp(buf, "ababcd", 6))
  595.     exit(0); /* libc version works properly.  */
  596.   else
  597.     exit(1);
  598. }
  599. EOF
  600. eval $compile
  601. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  602.   DEFS="${DEFS}#define USEBCOPY 1
  603. "
  604. fi
  605. rm -f conftest*
  606.  
  607. echo checking for vsprintf
  608. echo "#include <varargs.h>
  609. #include <stdio.h>
  610. main() { exit(0); } t() { vsprintf(); }" > conftest.c
  611. if eval $compile; then
  612.   DEFS="${DEFS}#define USEVARARGS 1
  613. "
  614. fi
  615. rm -f conftest*
  616.  
  617.  
  618. echo checking for putenv
  619. echo "
  620. main() { exit(0); } t() { putenv(); }" > conftest.c
  621. if eval $compile; then
  622.   :
  623. else
  624.   DEFS="${DEFS}#define NEEDSETENV 1
  625. " LIBOBJS="$LIBOBJS putenv.o"
  626. fi
  627. rm -f conftest*
  628.  
  629.  
  630. echo "${DEFS}#include <utmp.h>" > conftest.c
  631. eval "$CPP conftest.c > conftest.out 2>&1"
  632. if egrep "ut_host" conftest.out >/dev/null 2>&1; then
  633.   DEFS="${DEFS}#define UTHOST 1
  634. "
  635. fi
  636. rm -f conftest*
  637.  
  638.  
  639. echo checking for pid_t
  640. echo "#include <sys/types.h>
  641. main() { exit(0); } t() { pid_t x; }" > conftest.c
  642. if eval $compile; then
  643.   DEFS="${DEFS}#define PID_T_DEFINED 1
  644. "
  645. fi
  646. rm -f conftest*
  647.  
  648.  
  649. echo checking for sig_t
  650. echo "#include <sys/types.h>
  651. #include <signal.h>
  652. main() { exit(0); } t() { sig_t x; }" > conftest.c
  653. if eval $compile; then
  654.   DEFS="${DEFS}#define SIG_T_DEFINED 1
  655. "
  656. fi
  657. rm -f conftest*
  658.  
  659.  
  660. echo checking for long file names
  661. (echo 1 > conftest9012345) 2>/dev/null
  662. (echo 2 > conftest9012346) 2>/dev/null
  663. val=`cat conftest9012345 2>/dev/null`
  664. if test -f conftest9012345 && test "$val" = 1; then :
  665. else DEFS="${DEFS}#define NAME_MAX 14
  666. "
  667. fi
  668. rm -f conftest9012345 conftest9012346
  669.  
  670. echo checking for sys/socket.h
  671. cat <<EOF > conftest.c
  672. $DEFS
  673. #include <sys/socket.h>
  674. EOF
  675. err=`eval "$CPP conftest.c 2>&1 >/dev/null"`
  676. if test -z "$err"; then
  677.   :
  678. else
  679.   DEFS="${DEFS}#define NAMEDPIPE 1
  680. "
  681. fi
  682. rm -f conftest*
  683.  
  684.  
  685. echo checking for SVR4 elf library
  686. if test -f /usr/ucblib/libucb.a; then # SVR4
  687.   DEFS="${DEFS}#define SVR4 1
  688. " DEFS="${DEFS}#define BUGGYGETLOGIN 1
  689. " LIBS="$LIBS -lelf"
  690. fi
  691.  
  692. echo checking for SCO crypt and sec libraries
  693. test -f /lib/libcrypt_d.a && LIBS="$LIBS -lcrypt_d"
  694. test -f /lib/libcrypt.a && LIBS="$LIBS -lcrypt"
  695. test -f /lib/libsec.a && LIBS="$LIBS -lsec"
  696.  
  697. echo checking for IRIX sun library
  698. test -f /lib/libsun.a && LIBS="$LIBS -lsun"
  699.  
  700. echo checking for Xenix
  701. cat <<EOF > conftest.c
  702. $DEFS
  703. #if defined(M_XENIX) && !defined(M_UNIX)
  704.   yes
  705. #endif
  706.  
  707. EOF
  708. eval "$CPP conftest.c > conftest.out 2>&1"
  709. if egrep "yes" conftest.out >/dev/null 2>&1; then
  710.   XENIX=1
  711. fi
  712. rm -f conftest*
  713.  
  714. if test -n "$XENIX"; then
  715.   DEFS="${DEFS}#define VOID_CLOSEDIR 1
  716. "
  717.   LIBS="$LIBS -lx"
  718.   case "$DEFS" in
  719.   *SYSNDIR*) ;;
  720.   *) LIBS="-ldir $LIBS" ;; # Make sure -ldir precedes any -lx.
  721.   esac
  722. fi
  723.  
  724.  
  725. if test -n "$prefix"; then
  726.   test -z "$exec_prefix" && exec_prefix='$(prefix)'
  727.   prsub="s%^prefix[     ]*=.*$%prefix = $prefix%"
  728. fi
  729. if test -n "$exec_prefix"; then
  730.   prsub="$prsub
  731. s%^exec_prefix[     ]*=.*$%exec_prefix = $exec_prefix%"
  732. fi
  733.  
  734. trap 'rm -f config.status; exit 1' 1 3 15
  735. echo creating config.status
  736. rm -f config.status
  737. cat <<EOF > config.status
  738. #!/bin/sh
  739. # Generated automatically by configure.
  740. # Run this file to recreate the current configuration.
  741. # This directory was configured as follows,
  742. # on host `(hostname || uname -n) 2>/dev/null`:
  743. #
  744. # $0 $*
  745.  
  746. case "\$1" in
  747.   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  748.   exec /bin/sh $0 $* ;;
  749. esac
  750.  
  751. trap 'rm -f Makefile config.h; exit 1' 1 3 15
  752. CC='$CC'
  753. CPP='$CPP'
  754. INSTALL='$INSTALL'
  755. INSTALL_PROGRAM='$INSTALL_PROGRAM'
  756. INSTALL_DATA='$INSTALL_DATA'
  757. LIBOBJS='$LIBOBJS'
  758. LIBS='$LIBS'
  759. srcdir='$srcdir'
  760. DEFS='$DEFS'
  761. prefix='$prefix'
  762. exec_prefix='$exec_prefix'
  763. prsub='$prsub'
  764. EOF
  765. cat <<\EOF >> config.status
  766.  
  767. top_srcdir=$srcdir
  768. for file in Makefile; do
  769.   srcdir=$top_srcdir
  770.   # Remove last slash and all that follows it.  Not all systems have dirname.
  771.   dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  772.   if test "$dir" != "$file"; then
  773.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  774.     test ! -d $dir && mkdir $dir
  775.   fi
  776.   echo creating $file
  777.   rm -f $file
  778.   echo "# Generated automatically from `basename $file`.in by configure." > $file
  779.   sed -e "
  780. $prsub
  781. s%@CC@%$CC%g
  782. s%@CPP@%$CPP%g
  783. s%@INSTALL@%$INSTALL%g
  784. s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
  785. s%@INSTALL_DATA@%$INSTALL_DATA%g
  786. s%@LIBOBJS@%$LIBOBJS%g
  787. s%@LIBS@%$LIBS%g
  788. s%@srcdir@%$srcdir%g
  789. " $top_srcdir/${file}.in >> $file
  790. done
  791.  
  792. echo creating config.h
  793. # Ultrix awk loses trailing comments from the header file, but
  794. # that's not fatal.
  795. rm -f conftest.h
  796. echo "/* config.h.  Generated automatically by configure.  */" > conftest.h
  797. echo "$DEFS
  798. /* END_OF_DEFS */" |
  799. awk '
  800. # The escaped newlines are to work around a bug in GNU m4 0.99
  801. # in quoting more than 2 arguments in a single line.
  802. BEGIN { filenum = 1 }
  803. filenum == 1 && $1 == "#define" \
  804. { defs[$2] = $3
  805.   defined[$2] = 1
  806.   for (i = 4; i <= NF; i++)
  807.     defs[$2] = defs[$2] " " $i
  808. }
  809. /END_OF_DEFS/ { filenum = 2; next }
  810. filenum == 2 && $1 == "#define" && \
  811. defined[$2] == 1 {
  812.   $3 = defs[$2]
  813.   print; next
  814. }
  815. filenum == 2 && $1 == "#undef" && \
  816. defined[$2] == 1 {
  817.   $1 = "#define"
  818.   $2 = $2 " " defs[$2]
  819.   print; next
  820. }
  821. filenum == 2 { print }
  822. ' - $top_srcdir/config.h.in >> conftest.h
  823. if cmp -s config.h conftest.h 2>/dev/null; then
  824.   # The file exists and we would not be changing it.
  825.   rm -f conftest.h
  826. else
  827.   rm -f config.h
  828.   mv conftest.h config.h
  829. fi
  830.  
  831. EOF
  832. chmod +x config.status
  833. test -n "$no_create" || ./config.status
  834.  
  835.